*     *****************************************************************    *;
*     *****************************************************************    *;
*   Date:        June 2021   		                                       *;
*   Authors:     Dellmuth, Scholte, Tallberg, and Verhaegen                *;
*   Purpose:     Replicate Appendix tables E21-E42	     				   *;
*     *****************************************************************    *;
*     *****************************************************************    *;

set more off     
vers 16.1


* Recoding WVS
*     *****************************************************************        *;
*     *****************************************************************        *;

use "citizens_BR DE RU US PHI - variables dropped for dyads recoded.dta", clear

drop weight
rename S018 weight
rename D_INTERVIEW id
sum weight, d
svyset id [pweight=weight]

tab B_COUNTRY

tab sex, nol // 2=female
recode sex 2=1 1=0, gen(female)
tab female


* Run regressions WVS - CITIZENS
*     *****************************************************************        *;

* Tables E31-E38

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo all6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo all7


#delimit ;
esttab all1 all2 all3 all4 all5 all6 all7 using E31.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra7


#delimit ;
esttab bra1 bra2 bra3 bra4 bra5 bra6 bra7 using E32.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger7


#delimit ;
esttab  ger1 ger2 ger3 ger4 ger5 ger6 ger7 using E33.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi7


#delimit ;
esttab  phi1 phi2 phi3 phi4 phi5 phi6 phi7 using E34.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus7


#delimit ;
esttab  rus1 rus2 rus3 rus4 rus5 rus6 rus7 using E35.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.

svy:reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us1
svy:reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us2
svy:reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us3
svy:reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us4
svy:reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us5
svy:reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us6
svy:reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us7


#delimit ;
esttab  us1 us2 us3 us4 us5 us6 us7 using E36.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr //This R-squared is the population R-squared and can be thought of as the adjusted R-squared.







*     *****************************************************************        *;
******* ELITES
*     *****************************************************************        *;

use "elites_BR DE RU US PHI - variables dropped for dyads recoded.dta", clear
gen female=0
replace female=1 if sex==2
rename education edu
rename polsatisfaction satis

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo bra1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female i.country
eststo bra2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo bra3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo bra4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo bra5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo bra6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female  i.country
eststo bra7

#delimit ;
esttab bra1 bra2 bra3 bra4 bra5 bra6 bra7 using E37.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==76
eststo bra7


#delimit ;
esttab bra1 bra2 bra3 bra4 bra5 bra6 bra7 using E38.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==276
eststo ger7


#delimit ;
esttab  ger1 ger2 ger3 ger4 ger5 ger6 ger7 using E39.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==608
eststo phi7
	

#delimit ;
esttab  phi1 phi2 phi3 phi4 phi5 phi6 phi7 using E40.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==643
eststo rus7


#delimit ;
esttab  rus1 rus2 rus3 rus4 rus5 rus6 rus7 using E41.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  

reg confios edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us1
reg confICC edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us2
reg confIMF edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us3
reg confUN edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us4
reg confWB edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us5
reg confWHO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us6
reg confWTO edu finsathousehold leftright gal feelworld feelcountry confgov satis age female if country==840
eststo us7


#delimit ;
esttab  us1 us2 us3 us4 us5 us6 us7 using E42.rtf,
starlevels(* .05 ** .01 *** .001) b(%9.3f) r2(%9.3f) nodepvars 
se(%9.2f) replace;
#delimit cr  



